home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODF-Interest Archive / June 96 / Re FW_CCommand DoIt.1 < prev    next >
Encoding:
Internet Message Format  |  1996-12-03  |  1.5 KB  |  [TEXT/ttxt]

  1. Subject:     Re:FW_CCommand::DoIt
  2. Sent:        6/2/96 9:07 AM
  3. Received:    6/3/96 7:58 AM
  4. From:        Greg Friedman, friedman@cognosis.com
  5. Reply-To:    ODF Interest, ODF-Interest@CILabs.ORG
  6. To:          OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
  7.  
  8. At 1:45 AM 6/2/96, Hutchings Software Development wrote:> I noticed that
  9. FW_CCommand::DoIt is pure virtual. This caused a subtle
  10. > bug for me this evening because I didn't initially realize that my
  11. > override had
  12. > to call "SaveUndoState" to make it get called!
  13. >
  14. > So, I eventually lifted the following out of
  15. > FW_CClipboardCommand::DoIt.
  16. >
  17. >         if (GetCanUndo(ev))
  18. >                 this->SaveUndoState(ev);        // save current state,
  19. >for later Undo
  20. >
  21. > Would it be possible (for future release) to either move this to
  22. > FW_CCommand::Execute, or put it in FW_CCommand:DoIt? It took me a good
  23. > 15 minutes with MW Debug to figure out that I was missing those from
  24. > my DoIt override. If the undo/redo methods are defined in FW_CCommand,
  25. > why not wire them up too?
  26.  
  27. Brad,
  28.  
  29. I agree this is confusing. I'm not sure whether the answer is to have
  30. execute call SaveUndoState or to remove SaveUndoState from FW_CCommand.
  31. Since SaveUndoState isn't necessary for command processing, and it is often
  32. simpler to save undo state data in a DoIt implementation, I'm leaning
  33. towards removing it.
  34.  
  35. gsf.
  36.  
  37.  
  38. _________________________________________________________
  39. Greg Friedman      ODF Engineering       Apple Computer
  40.  
  41.